package com.Graphics;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.*;
import android.view.View.*;

public class DrawView extends View implements OnTouchListener {
	
	public ColorBall uno;
	public ColorBall duo;
	public ColorBall tres;
	private Paint paint;
	public Context cxt;
	
	
	public DrawView(Context cxt){
		super(cxt);
		uno = new ColorBall(cxt,5,5);
		setFocusableInTouchMode(true);
		setOnTouchListener(this);

	}
	
	@Override
	protected void onDraw(Canvas cvs){
		cvs.drawColor(Color.BLUE);
		
		uno.onMove(5,5,uno);
		
		paint = new Paint();
		paint.setColor(Color.CYAN);
		paint.setAntiAlias(true);
		
		cvs.drawCircle(uno.getX(), uno.getY(), 50, paint);
		invalidate();
	}

	public boolean onTouch(View v, MotionEvent event) {
		uno.setX((int)event.getX());
		uno.setY((int)event.getY());
		invalidate();
		return true;
	}
	

}
